package com.kc.business.service.impl;

import com.kc.business.domain.KcGoodsOrderShipping;
import com.kc.business.mapper.KcGoodsOrderShippingMapper;
import com.kc.business.service.IKcGoodsOrderShippingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * TODO
 *
 * @author zhangshuo
 * @version 1.0
 * @date 2020/12/12
 */
@Service
public class KcGoodsOrderShippingServiceImpl implements IKcGoodsOrderShippingService {
    @Resource
    KcGoodsOrderShippingMapper kcGoodsOrderShippingMapper;

    /**
     * 批量保存发货记录
     *
     * @param kcGoodsOrderShippingList
     */
    @Override
    public int saveBatch(List<KcGoodsOrderShipping> kcGoodsOrderShippingList) {
        return kcGoodsOrderShippingMapper.insertList(kcGoodsOrderShippingList);
    }

    @Override
    public List<KcGoodsOrderShipping> getList(Integer orderId) {
        if (orderId != null && orderId > 0) {
            KcGoodsOrderShipping shipping = new KcGoodsOrderShipping();
            shipping.setOrderId(orderId);
            return kcGoodsOrderShippingMapper.select(shipping);
        }
        return null;
    }
}
